@echo off
if not exist out (
    md out
)
if exist tmp (
    rd /s /q tmp
)
md tmp\dist
md tmp\node_modules\@terminus-term
xcopy dist tmp\dist /s /q
xcopy mylib\@terminus-term tmp\node_modules\@terminus-term /s /q
copy main.js tmp\
copy mylogger.bundle.js tmp\
copy server.bundle.js tmp\
copy ngterm.ico tmp\
copy package.json tmp\
cd tmp
call electron-packager . --no-prune  --overwrite --ignore=node_modules --extra-resource=node_modules --out=. --icon=./ngterm.ico --platform=win32 --arch=x64 --asar --electron-zip-dir=D:/Software/electron/
cd ..
if exist out\ngterm-win32-x64 (
    rd /s /q out\ngterm-win32-x64
)
move /Y tmp\ngterm-win32-x64 out\
copy ngTermCfg.json out\ngterm-win32-x64